<div class="col-xl-12 col-lg-12 col-md-6">
    <div class="widget widget_categories">
        <h6 class="widgettitle"><span>@lang('Categories')</span></h6>
        <ul>
            @foreach($categories as $category)
                @php
                    $slug = str_slug($category->name)
                @endphp
            <li>
                <a href="{{route('cats.blog',[$category->id, $slug])}}">{!! __($category->name) !!}
                    <span class="count float-right">({!! $category->posts()->count() !!})</span>
                </a>
            </li>
            @endforeach
        </ul>
    </div>

</div>